<?php
/**
 *   Joomdiet - administrator/components/views/recipecategory/view.html.php
 *   Author: Juan Dapena Paz (juan@bittingbits.com)
 *   Copyright (C) 2010 Bitting Bits S.L.
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class JoomdietViewRecipeCategory extends JView
{
    function display($tpl=null)
    {
        JToolBarHelper::save();
        JToolBarHelper::back();
        
        $cid = JRequest::getVar('cid');
        
        // loading context specific title
        if ($cid) {
            JToolBarHelper::title(JText::_('COM_JOOMDIET_EDIT_RECIPE_CATEGORY_TITLE'));
        } else {
            JToolBarHelper::title(JText::_('COM_JOOMDIET_ADD_RECIPE_CATEGORY_TITLE'));
        }
        
        $model =& $this->getModel();
        $row =& $this->get('RecipeCategory');
        $categories =& $this->get('Data');
        
        // loading needed form data
        $this->assignRef('row', $row);
        $this->assignRef('fcategories', $categories);
        
        parent::display($tpl);
    }
}
?>
